#include "app_timer.h"
#include "app_tft.h"
//#include "app_flash.h"
//#include "key.h"
#include "functionhandle.h"
#include "api_io.h"
#include "lv_port_disp_template.h"
#include "spi_flash.h"
#include "nes_main.h"
#include "lv_example_widgets.h"
void led_task();
void debugtask();
void key_event_handler();
void key_scan();
int main() 
{
    h_api_io.init(&h_api_io);
    //weigen_exint_line_init();
    beep.set(&beep);
    board_init();
    delay_init();
    beep.clr(&beep);
    init_tft();
    //set_draw_window(0, 0, 239, 239);
    //nes_main();
    lv_init();
    lv_port_disp_init();
    lv_example_button_1();
    while(1)
    {
        key_scan();
        key_event_handler();
        lv_tick_inc(1);
        lv_task_handler();
        
    }
	return 0;
}

void debugtask()
{
    static int cnt = 0;
    //debug(0,"debugtask%d\r",cnt++);
}
